﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Numerics;
using System.Security.Cryptography;

namespace dst
{
    class Util
    {
        public static int P32 = 1609946123;
        public static BigInteger P128 = BigInteger.Parse("333933792727321412652339490527990979711");

        public static HTDup<Exp> simpTable = new HTDup<Exp>();

        public static BigInteger GetSign(string str)
        {
            MD5 md5hash = new MD5CryptoServiceProvider();
            BigInteger r = new BigInteger(md5hash.ComputeHash(Encoding.Default.GetBytes(str)));
            r %= P128;
            if (r < 0)
                r += P128;
            return r;
        }

        public static Dictionary<Polynomial, Matrix<Exp>> dicTransM = new Dictionary<Polynomial, Matrix<Exp>>();
    }
}
